#! /bin/sh
### BEGIN INIT INFO
# Provides:          ddos
# Required-Start:    $remote_fs $network
# Required-Stop:     $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts ddos deflate
# Description:       Starts daemon which monitors and automatically bans ip addresses with many connections.
### END INIT INFO

# Init script to control ddos daemon
#
# Jefferson Gonzalez <jgmdev@gmail.com>

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

DAEMON=/usr/local/sbin/ddos
INAME="ddos-deflate"
DESC="basic anti ddos system"
LOGDIR=/var/log  # Log directory to use

test -x $DAEMON || exit 0

set -e

case "$1" in
    start)
        /usr/local/sbin/ddos --start
        ;;
    stop)
        /usr/local/sbin/ddos --stop
        ;;
    status)
        /usr/local/sbin/ddos --status
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: /etc/init.d/ddos {start|stop|restart|status}"
        exit 1
        ;;
esac

exit 0
